<%layout("/common/g_layout.html"){%>


<div class="container-fluid content">
    <div class="row">
        <div class="col-md-7 left">
            <!-- <hr> -->
            <%if(type==0){%>
            <div class="good-choice">
                精选
            </div>
            <%}%>
            <%if(type==1){%>
            <div class="good-choice">
                体育
            </div>
            <%}%>
            <%if(type==2){%>
            <div class="good-choice">
                动漫
            </div>
            <%}%>
            <%if(type==3){%>
            <div class="good-choice">
                电影
            </div>
            <%}%>
            <div class="choice-content">
                <%
                for(topic in topicsHot.list){
                %>
                <div class="row">
                    <div class="col-md-1 zan" data-groupid=${topic.id}>
                        <span class="glyphicon glyphicon-heart heart"
                        <%if(topic.state==1){%>data-iszan="1"<%}%>></span>
                        <br>
                        <span class="heart-count">${topic.zan}</span>
                    </div>
                    <div class="col-md-10 details">
                        <div class="theme" style="color: blue;"><a href="/topic/goTopic?id=${topic.id}" title="">${topic.name}</a>
                        </div>
                        <div class="summary">${topic.topic_text}</div>
                        <div class="from-info">来自 <span class="from-team">${topic.group_name}</span> <span
                                class="from-time">${printTime(topic.update_time)}</span></div>
                    </div>
                </div>
                <%}%>

            </div>
        </div>
        <div class="col-md-4 col-md-offset-1 right th-guess">
            <div class="recommend-team">推荐小组</div>
            <div id="guess-teams">
                <%
                for(g in group){
                %>
                <div>
                    <div><img src="${g.imageurl}" class="img-circle" height="60" width="60" alt=""></div>
              <span class="team-name-and-members">
                <span class="team-name">${g.name}</span>
              <br>
              <br><span class="team-members">${g.num}位成员</span>
              </span>
                    <button type="button" class="btn btn-default btn-sm th-join" data-groupid="${g.id}">
                        <span class="glyphicon glyphicon-plus"></span>加入小组
                    </button>
                </div>
                <%}%>

            </div>
        </div>
    </div>
    <div class="row pages">
        <div class="col-md-7 col-md-offset-4">
            <!-- Pager -->
            <nav>
                <ul class="pagination">
                    <li>
                        <a href="
                            <%
                            if(topicsHot.pager.pageNumber==1){
                                  %>
                                  #
                                  <%
                            }else{
                            %>
                                ${ctxPath}/group/toHotTopic?page=${topicsHot.pager.pageNumber-1}
                            <%
                            }
                            %>" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <%
                    if(topicsHot.pager.pageCount<=5){
                    i = 0;
                    while(true){
                    i++;
                    if(i>topicsHot.pager.pageCount){
                    break;
                    }

                    %>
                    <li><a href="${ctxPath}/group/toHotTopic?page=${i}">${i}</a></li>
                    <%}}%>

                    <%
                    var i;
                    if(topicsHot.pager.pageCount>5){
                    if(topicsHot.pager.pageNumber-3>0){
                    i=topicsHot.pager.pageNumber-3;
                    }else{
                    i = 0;
                    }
                    var j = i;
                    while(true){
                    if(i-j>5||i>=topicsHot.pager.pageCount){
                    break;
                    }
                    i++;

                    %>
                    <li><a href="${ctxPath}/group/toHotTopic?page=${i}">${i}</a></li>
                    <%}}%>

                    <li>
                        <a href="
					      <%
                            if(topicsHot.pager.pageNumber==topicsHot.pager.pageCount){
                                  %>
                                  #
                                  <%
                            }else{
                            %>
                                ${ctxPath}/group/toHotTopic?page=${topicsHot.pager.pageNumber+1}
                            <%
                            }
					       %> " aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>

<%include("/common/footer.html"){}%>

<script type="text/javascript" src="${ctxPath}/group/js/scripts/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="${ctxPath}/group/js/scripts/nav.js"></script>
<script type="text/javascript" src="${ctxPath}/group/js/scripts/tog.js"></script>


<%}%>

